package cn.lgwen.candy.connector.kafka010.source;

import org.apache.kafka.common.PartitionInfo;

/**
 * 2019/12/26
 * aven.wu
 * danxieai258@163.com
 */
public class KafkaPartitionInfo {

    private String topic;

    private int partition;

    private long offset;

    public KafkaPartitionInfo(PartitionInfo partitionInfo) {
        this.topic = partitionInfo.topic();
        this.partition = partitionInfo.partition();
        this.offset = 0;
    }

    public KafkaPartitionInfo() {
        this.offset = 0;
    }

    public KafkaPartitionInfo(String topic, int partition, long offset) {
        this.topic = topic;
        this.partition = partition;
        this.offset = offset;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public int getPartition() {
        return partition;
    }

    public void setPartition(int partition) {
        this.partition = partition;
    }

    public long getOffset() {
        return offset;
    }

    public void setOffset(long offset) {
        this.offset = offset;
    }
}
